<%@ page language="java" %>
<%
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("max-age", 0);
    response.setDateHeader("Expires", 0);
%>
<%@ page import="com.scalar.chiptrack.utils.ConfigManager"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>


<html>

<HEAD>
	<TITLE>ScalarSoft - ChipTrac - Transit Lot Numbers </TITLE>
    <META http-equiv='Content-Type' content='text/html; charset=windows-1252'>
    <LINK href='<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css' type='text/css' rel='stylesheet'>

    <script language='javascript' >

    function closeWindow()
    {
        window.close();
    }

    function pickLotNumber( lotNumber, vendorLotNumber, shipQty, waferId )
    {
        var opener  = window.opener;
        opener.assignLotNumber ( lotNumber, vendorLotNumber, shipQty, waferId );
        closeWindow();
    }

    function pickTestLotNumber( lotNumber, shipQty )
    {
        var opener  = window.opener;
        opener.assignTestLotNumber ( lotNumber, shipQty );
        closeWindow();
    }
    </script>
</HEAD>
<logic:present name="closeWindowAfterSessionExp">
    <!--SESSION EXPIRED START-->
    <BODY bgcolor='ffffff' marginheight='0' marginwidth='0' topmargin='0' leftmargin='0' >
        <TABLE cellpadding='0' cellspacing='0' bgcolor='FDF5E6' border="0" width="100%"  height="100%" align=center>
            <TR>
                <TD>
                    <TABLE align="center" border="0" width="40%" bgcolor="#FDF5E6">
                        <TR><TD>&nbsp;</TD></TR>
                        <TR><TD align="center" ><font class="NArialL" ><font color="red"><b>Session has been time out , Please close this window and login again.<b></font></font></TD></TR>
                        <TR><TD>&nbsp;</TD></TR>
                        <TR><TD align="center" ><a href="javascript:window.close();"><font class='NArialL'>[Close this window]</font></a></TD></TR>
                    </TABLE>
                </TD>
           </TR>
           <TR><TD>&nbsp;</TD></TR>
        </TABLE>
    </BODY>
    <!--SESSION EXPIRED END-->
</logic:present>
<logic:notPresent name="closeWindowAfterSessionExp">
<BODY bgcolor='ffffff' marginheight='0' marginwidth='0' topmargin='0' leftmargin='0'>
<TABLE align='center' border='0' width='100%' >
    <TR>
        <td align='center' class="NArialW">Transit Lot Numbers</td>
    </TR>
    <TR>
        <TD align='center'>&nbsp;</TD>
    </TR>
    <TR>
        <TD>
          <chiptrack:info styleClass="NArialL" />
          <chiptrack:errors styleClass="NArialL" />
        </TD>
    </TR>
    <TR>
        <TD align='center'>
			<TABLE align="center" border="0" width="50%">
                <% int lotNumbersCount = 0; %>
                <logic:present name="lotNumbers" scope="request">
                    <logic:equal name='type' value='wafer%'>
                        <TR bgColor="#993333" align="center">
                            <TD class="NArialL"><FONT style="color:#ffffff;">Sl.No</FONT></TD>
                            <TD class="NArialL"><FONT style="color:#ffffff;">Lot Number</FONT></TD>
                            <TD class="NArialL"><FONT style="color:#ffffff;">Wafer Store Location</FONT></TD>
                        </TR>
                    </logic:equal>
                    <logic:equal name='type' value='class%'>
                        <TR bgColor="#993333" align="center">
                            <TD class="NArialL"><FONT style="color:#ffffff;">Sl.No</FONT></TD>
                            <TD class="NArialL"><FONT style="color:#ffffff;">Lot Number</FONT></TD>
                            <TD class="NArialL"><FONT style="color:#ffffff;">Location</FONT></TD>
                            <TD class="NArialL"><FONT style="color:#ffffff;">Quantity In</FONT></TD>
                        </TR>
                    </logic:equal>
                    <logic:iterate id="transitLotNumber" name="lotNumbers" scope="request" >
                        <% lotNumbersCount++; %>
                        <logic:equal name='type' value='wafer%'>
                            <TR bgcolor="<%=(lotNumbersCount%2 == 0 ? "#DEE1E2" : "#FFFFEE")%>" align="center">
                                <TD class="NArialL"><%=lotNumbersCount%></TD>
                                <TD class="NArialL"><A href="javascript:pickLotNumber('<bean:write name="transitLotNumber" property="lotNumber"/>','<bean:write name="transitLotNumber" property="vendorLotNumber"/>','<bean:write name="transitLotNumber" property="shipQty"/>','<bean:write name="transitLotNumber" property="waferId"/>')"><bean:write name="transitLotNumber" property="lotNumber"/></A></TD>
                                <TD class="NArialL"><bean:write name="transitLotNumber" property="nextLocation"/></TD>
                            </TR>
                        </logic:equal>
                        <logic:equal name='type' value='class%'>
                            <TR bgcolor="<%=(lotNumbersCount%2 == 0 ? "#DEE1E2" : "#FFFFEE")%>" align="center">
                                <TD class="NArialL"><%=lotNumbersCount%></TD>
                                <TD class="NArialL"><A href="javascript:pickTestLotNumber('<bean:write name="transitLotNumber" property="lotNumber"/>','<bean:write name="transitLotNumber" property="shipQty"/>')"><bean:write name="transitLotNumber" property="lotNumber"/></A></TD>
                                <TD class="NArialL"><bean:write name="transitLotNumber" property="nextLocation"/></TD>
                                <TD class="NArialL"><bean:write name="transitLotNumber" property="shipQty"/></TD>
                            </TR>
                        </logic:equal>
                    </logic:iterate>
                </logic:present>
                <%
                    if ( lotNumbersCount == 0 )
                    {
                %>
                    <TR>
                        <TD colspan="3" class="NArialL"><FONT color='red'>No Lot Numbers Available in Transit</FONT></TD>
                    </TR>
                <%
                    }
                %>
                <TR><TD>&nbsp;</TD></TR>
                <TR><TD>&nbsp;</TD></TR>
                <TR><TD align="center" colspan="3"><a href="javascript:window.close();"><font class='NArialL'>[Close this window]</font></a></TD></TR>
            </TABLE>
        </TD>
    </TR>
    <TR><TD align='center'>&nbsp;</TD></TR>
</TABLE>
</BODY>
</logic:notPresent>
</html>
